
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="images/favicon.ico">
    <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png">
	<title>登录</title>
	<link rel="stylesheet" href="${root}css/seedsui.min.css">
    <style>
    .group{
        padding: 0 12px;
    }
    .group:after{
    height: 0;
    }
    .icon.active{
        color: #20aeff;
    }
    .scrollpicker{
    bottom: 258px;
    }
    </style>
</head>

<body ontouchstart="" style="background-color: white;">
	<header>
	    <div class="titlebar reverse">
	        <a class="titlebar-button" href="${root}">
                <img width="24px;" style="border-radius: 40px;" height="24px;" src="${root}img/logo.png" />
            </a>
	        <h1 class="titlebar-title text-center">用户登录</h1>
	        <a href="${root}reg" class="titlebar-button SID-BtnSubmit"><span>注册</span></a>
	    </div>
	</header>
	<article >
	<div style="text-align: center;" onclick="location.href='${root}'">
	<img class="slide-banner" style="height: 150px;width: 150px;" src="${root}img/logo.png">
	<h1>心课堂（IEPSY.COM）</h1>
	</div><br/>
	<form id="form1" action="${root}users/login">
	<div class="group">
                <div class="inputbox underline">
                    <label class="inputbox-left">手机号</label>
                    <div class="inputbox-right inputbox" data-input="clear">
                        <input type="text" class="input-text" placeholder="手机号/登录名" id="username" name="username"/>
                        <i class="icon icon-rdoclose-fill color-placeholder" style="font-size: 20px;line-height: 24px;text-align: center;display: none;"></i>
                    </div>
                </div>
                <div class="inputbox underline">
                    <label class="inputbox-left">密码</label>
                    <div class="inputbox-right inputbox" data-input="reveal">
                        <input type="password" class="input-text" placeholder="密码" id="password" name="password">
                        <i class="icon icon-eye-fill color-placeholder"></i>
                    </div>
                </div>
                <div class="inputbox ">
                    <label class="inputbox-left"></label>
                    <div class="inputbox-right inputbox" data-input="reveal" >
                    </div>
                    <small onclick="location.href='${root}forget'" style="margin-top:10px; padding: 10 10px;border-radius: 4px;">忘记密码?</small>
                </div>
           
        	  <div style="line-height: 50px;padding: 8px 16px 16px 0px;">
                <a id="sub" class="button block primary" style="margin:8px;border-radius: 4px;width: 100%;">
                    <span>登录</span>
                </a>
              </div>  
              <div class="text-center">或</div>
              <div style="line-height: 50px;padding: 8px 16px 16px 0px;">
                <a id="wx_login" class="button block submit" style="margin:8px;border-radius: 4px;width: 100%;">
                    <i class="icon icon-weixin-fill"></i><span>微信一键登录</span>
                </a>
              </div>
        </div>
        </form>
        
	</article>
	<script src="${root}js/jquery-2.1.3.js"></script>
    <script src="${root}js/seedsui.min.js"></script>
    
	<script>
	$(function(){
		$("#wx_login").click(function(){
			var ua = window.navigator.userAgent.toLowerCase();
			if (ua.match(/MicroMessenger/i) == 'micromessenger') {
				location.href="${root}wx_login${isEmpty(p.goto)?'':'?goto='+p.goto}"
			}else{
				alert("只支持在微信中一键登录!")
			}
		})
		$("#sub").click(function(){
			if($("#username").val().length<1){
				alert("手机号不能为空")
			}else if($("#password").val().length<1){
				alert("密码不能为空")
			}else{
			 $.ajax({

			     type: 'POST',

			     url: '${root}raw/users/checkuser' ,

			    data: {username:$("#username").val(),password:$("#password").val()} ,

			    success: function(data){
			    	if(data=="success"){
			    		$("#form1").submit();
			    	}else{
			    		alert("用户不存在或输入错误!")
			    	}
			    	
			    } ,

			    dataType: 'text'

			});
			}
		})
		
	})
	
	   
	</script>
</body>
</html>
